{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "name": "LinearRegression_DiabetetesDataset.ipynb",
      "provenance": [],
      "authorship_tag": "ABX9TyOX2PFl/sSVNnqzLiL0Mm+i"
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    },
    "language_info": {
      "name": "python"
    }
  },
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "XHPSgOH4ZPyH"
      },
      "source": [
        "## Normal Implementation"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "2vZFjgb7Yrh8"
      },
      "source": [
        "# import matplotlib.pyplot as plt\n",
        "# import numpy as np\n",
        "# from sklearn import datasets, linear_model\n",
        "# from sklearn.metrics import mean_squared_error, r2_score\n",
        "\n",
        "# # Load the diabetes dataset\n",
        "# diabetes_X, diabetes_y = datasets.load_diabetes(return_X_y=True)\n",
        "\n",
        "# # Use only one feature\n",
        "# diabetes_X = diabetes_X[:, np.newaxis, 2]\n",
        "\n",
        "# # Split the data into training/testing sets\n",
        "# diabetes_X_train = diabetes_X[:-20]\n",
        "# diabetes_X_test = diabetes_X[-20:]\n",
        "\n",
        "# # Split the targets into training/testing sets\n",
        "# diabetes_y_train = diabetes_y[:-20]\n",
        "# diabetes_y_test = diabetes_y[-20:]\n",
        "\n",
        "# # Create linear regression object\n",
        "# regr = linear_model.LinearRegression()\n",
        "\n",
        "# # Train the model using the training sets\n",
        "# regr.fit(diabetes_X_train, diabetes_y_train)\n",
        "\n",
        "# # Make predictions using the testing set\n",
        "# diabetes_y_pred = regr.predict(diabetes_X_test)\n",
        "\n",
        "# # The coefficients\n",
        "# print('Coefficients: \\n', regr.coef_)\n",
        "# # The mean squared error\n",
        "# print('Mean squared error: %.2f'\n",
        "#       % mean_squared_error(diabetes_y_test, diabetes_y_pred))\n",
        "# # The coefficient of determination: 1 is perfect prediction\n",
        "# print('Coefficient of determination: %.2f'\n",
        "#       % r2_score(diabetes_y_test, diabetes_y_pred))\n",
        "\n",
        "# # Plot outputs\n",
        "# plt.scatter(diabetes_X_test, diabetes_y_test,  color='black')\n",
        "# plt.plot(diabetes_X_test, diabetes_y_pred, color='blue', linewidth=3)\n",
        "\n",
        "# plt.xticks(())\n",
        "# plt.yticks(())\n",
        "\n",
        "# plt.show()"
      ],
      "execution_count": 22,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "ocQxsjmAZTCi"
      },
      "source": [
        "## OOP style Implementation"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "BORTyWuxZF8I"
      },
      "source": [
        "import matplotlib.pyplot as plt\n",
        "import numpy as np\n",
        "from sklearn import datasets, linear_model\n",
        "from sklearn.metrics import mean_squared_error, r2_score\n",
        "from sklearn.model_selection import train_test_split"
      ],
      "execution_count": 1,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "t-KgGBALZb68"
      },
      "source": [
        "class Model :\n",
        "\n",
        "  def __init__(self, model_name = 'LinReg'):\n",
        "    self.diabetes_X, self.diabetes_y = datasets.load_diabetes(return_X_y=True)\n",
        "    self.diabetes_X = self.diabetes_X[:, np.newaxis, 2]\n",
        "\n",
        "    if model_name == 'LinReg':\n",
        "      self.LR = linear_model.LinearRegression()\n",
        "\n",
        "  def split(self , fraction = 0.2):\n",
        "    X_train , X_test , y_train , y_test = train_test_split(self.diabetes_X, self.diabetes_y , test_size=fraction)\n",
        "    return X_train , X_test , y_train , y_test\n",
        "\n",
        "  def fit(self):\n",
        "    self.LR.fit(X_train ,y_train)\n",
        "\n",
        "  def predict(self):\n",
        "    yp = self.LR.predict(X_test)\n",
        "    return yp\n",
        "\n",
        "  def plot(self):\n",
        "    plt.scatter(X_test , y_test)\n",
        "    plt.plot(X_test , yp , color='red')\n",
        "    plt.title('Validation Performance')\n"
      ],
      "execution_count": 23,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 281
        },
        "id": "9jVFLZjRaFcK",
        "outputId": "bf106660-9f28-476d-ba60-dce1e5312d49"
      },
      "source": [
        "#First Instantiate/Create Instance of the Model class. \n",
        "m = Model(model_name='LinReg')\n",
        "\n",
        "#Second Now call internal-functions/methods one by one.\n",
        "#1. \n",
        "X_train , X_test , y_train , y_test= m.split()\n",
        "\n",
        "#2. \n",
        "m.fit()\n",
        "\n",
        "#3. \n",
        "yp = m.predict()\n",
        "\n",
        "#4. \n",
        "m.plot()\n",
        "\n"
      ],
      "execution_count": 24,
      "outputs": [
        {
          "output_type": "display_data",
          "data": {
            "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAEICAYAAACktLTqAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nO3debwcZZ3v8c83IUAEJInE3JAEEsYEBL0CE0EHRQRHYGSJyyg6CioOjiiOyzAEZ0RcuIIbVwYuCi7AvECIIiEDIiKLAgNIQgDZIhGi4RAgQsJmzGT53T+qTk6fTvfprbq7uvr7fr36dbqfqq5+uvr0r596VkUEZmZWLKO6nQEzM8ueg7uZWQE5uJuZFZCDu5lZATm4m5kVkIO7mVkBObhbZiSFpFek978j6fP17NvE6/yDpF80m89OkfR2ScslvSBpr27nx/qLg7ttIunnkr5UIf1ISU9I2qLeY0XEP0XElzPI0/T0h2DTa0fExRHx1laPXeG1DpC0MQ3Gz0taIulDLRzyG8AnImLbiFicVT7N6uHgbqUuBN4vSWXpHwAujoj1XchTpz0eEdsCLwVOAs6XtHsjByj5IdoZuL+ZTEga3czzzAY5uFup+cDLgDcOJkgaDxwGXCRpH0m3SVotaYWksyVtWelAki6Q9JWSxyemz3lc0ofL9n2bpMWSnkurMU4t2fzr9O/qtET9ekkflHRLyfP/RtKdkp5N//5NybabJH1Z0q1pafwXknaodSIiMR9YBewuaZS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ZaQ+oLUkaCReU7VN6jt4F3JD+HywAjkp7kMwAZgK/6VC+26HpcyFpoqTRAJJ2ITkXj3Qo3+1Qz7mopuL3pU35zL9Ott6S1BFeDzwM/BKYkKbPBr5Xst/NwEpgDUm92cFp+i4kX+KlwI+BrbrdIt2Bc/Hh9P0uBT6Upm0DLALuBe4Hvk0P9hYB/g74HUnviH9L074EHJHe3zr9nJemn/suJc/9t/R5S4BDu/1eunUugHem/wN3A3cBh3f7vXTgXLw2jQsvklzJ3V/y3M2+L/168/QDZmYF5BGqZmYF5OBuZlZADu5mZgXk4G5mVkAO7mZmBeTgbmZWQA7uZmYF9P8BewOeTygJyCkAAAAASUVORK5CYII=\n",
            "text/plain": [
              "<Figure size 432x288 with 1 Axes>"
            ]
          },
          "metadata": {
            "tags": [],
            "needs_background": "light"
          }
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "u46JhVQzaHvy"
      },
      "source": [
        ""
      ],
      "execution_count": 3,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 290
        },
        "id": "K-b3m-o4aP6T",
        "outputId": "49c488b0-8771-4dcd-8b06-804f2739cebc"
      },
      "source": [
        "m.plot()"
      ],
      "execution_count": 4,
      "outputs": [
        {
          "output_type": "error",
          "ename": "NameError",
          "evalue": "ignored",
          "traceback": [
            "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
            "\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
            "\u001b[0;32m<ipython-input-4-825396d5c1d6>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mm\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mplot\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
            "\u001b[0;32m<ipython-input-2-0117e9825b7a>\u001b[0m in \u001b[0;36mplot\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m     20\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m     21\u001b[0m   \u001b[0;32mdef\u001b[0m \u001b[0mplot\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 22\u001b[0;31m     \u001b[0mplt\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mscatter\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mX_test\u001b[0m \u001b[0;34m,\u001b[0m \u001b[0my_test\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m     23\u001b[0m     \u001b[0mplt\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mplot\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mX_test\u001b[0m \u001b[0;34m,\u001b[0m \u001b[0myp\u001b[0m \u001b[0;34m,\u001b[0m \u001b[0mcolor\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m'red'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m     24\u001b[0m     \u001b[0mplt\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtitle\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'Validation Performance'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
            "\u001b[0;31mNameError\u001b[0m: name 'X_test' is not defined"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "HAhw1xfEaSMl"
      },
      "source": [
        ""
      ],
      "execution_count": 36,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "5-U5j26Jbvjs"
      },
      "source": [
        ""
      ],
      "execution_count": 28,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "tIQeXyuKb0JK"
      },
      "source": [
        ""
      ],
      "execution_count": null,
      "outputs": []
    }
  ]
}